//行业投资总额
const InvestmentIndex = {
    init(){
        this.ec01_bar();
        this.echart_map();
    },
    ec01_bar() {
        let ec01_bar=echarts.init($("#ec01_bar_investment")[0]);
        ec01_bar.clear();
        ec01_bar.setOption(com_bar_vertical);
        ec01_bar.setOption({
            grid:{
                top:'10%',
                right:'1%'
            },
            legend:{
                show:false,
            },
            xAxis: {
                type : 'category',
                //splitLine: {show:false},
                data : ['能源电力','交通运输','房地产','制造','信息技术','农业','娱乐休闲','基础设施','文化旅游','其他','总计']
            },
            yAxis: {
                type: 'value',
                name:'单位:亿美元',
                nameTextStyle:{
                    color:'#666',
                    fontSize:12*bodyScale,
                },
            },
            barWidth: '60%',
            tooltip : {
                formatter: function (params) {
                    var tar = params[1];
                    return tar.name + '<br/>' + tar.seriesName + ' : ' + tar.value;
                }
            },
            series: [ {
                name: '支出',
                type: 'bar',
                stack: '总量',
                itemStyle: {
                    normal: {
                        barBorderColor: 'rgba(0,0,0,0)',
                        color: 'rgba(0,0,0,0)'
                    },
                    emphasis: {
                        barBorderColor: 'rgba(0,0,0,0)',
                        color: 'rgba(0,0,0,0)'
                    }
                },
                data: [0, 979,1557,1725,1846,1931,1997,2052,2095,2107,0]
            },
            {
                name: '投资总额',
                type: 'bar',
                stack: '总量',
                label: {
                    normal: {
                        show: true,
                        position: 'top',
                        color:'#fff',
                        fontSize:16*bodyScale,
                    }
                },
                itemStyle:{
                    color: new echarts.graphic.LinearGradient(
                        0, 0, 0, 1,
                        [
                            {offset: 1, color: '#2377fe'},
                            //{offset: 0.5, color: '#188df0'},
                            {offset: 0, color: '#11e099'}
                        ]
                    )
                },
                data: [979,578,168,121,85,66,55,43,12,110,2217]
            }]
        });
    },
    /*echart_map() {
        let ec01_map=echarts.init($("#ec02_map_world")[0]);
        var option = {
            geo: {
                map: 'world',
                itemStyle: {
                    normal: {
                        areaColor: '#11172f',
                        borderColor: '#2377fe15'
                    },
                    emphasis: {
                        areaColor: '#2377fe15'
                    }
                }
            },
            series: [
                {
                    name: 'pm2.5',
                    type: 'scatter',
                    coordinateSystem: 'geo',
                    symbolSize: 12,
                    left:'-555555',
                    label: {
                        normal: {
                            show: false
                        },
                        emphasis: {
                            show: false
                        }
                    },
                    itemStyle: {
                        emphasis: {
                            borderColor: '#fff',
                            borderWidth: 1
                        }
                    }
                }
            ]
        }
        ec01_map.setOption(option);
    }*/
}
InvestmentIndex.init();